package com.n9.buymsg.event;


/**
 * action的事件
 * @Author: ice
 * @Date: 2020-06-24 9:39
 */
public class AppEvent<T> {
    public static final String LOGIN_FORM_INIT = "LOGIN_FORM_CREATE";//登陆窗口初始化
    public static final String LOGIN_FORM_LOGIN = "LOGIN_FORM_LOGIN";//登陆窗口登陆
    public static final String MAIN_FORM_INIT = "MAIN_FORM_CREATE";//主窗口初始化
    public static final String MAIN_FORM_EXTRACT_START = "MAIN_FORM_EXTRACT_START";//主窗启动采集
    public static final String LOG_MSG_VIEW = "LOG_MSG_VIEW";//日志显示
    public static final String QQ_LOGIN_SUCCESS = "QQ_LOGIN_SUCCESS";//QQ登陆成功
    public static final String QQ_NEW_MSG = "QQ_NEW_MSG";//接收到新消息
    public static final String BUY_MSG_STORE_SUCCESS = "BUY_MSG_STORE_SUCCESS";//求购消息存储成功
    public static final String QQ_LOGIN_FAILED = "QQ_LOGIN_FAILED";//QQ登陆失败
    public static final String QQ_OFFLINE = "QQ_OFFLINE";//QQ掉线

    public AppEvent(String name, T source) {
        this.name = name;
        this.source = source;
    }

    /**
     * 事件名称
     */
    private String name;
    /**
     * 事件源
     */
    private T source;

    /**
     * 同步标记
     */
    private boolean synchronizeFlag = true;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public T getSource() {
        return source;
    }
    public void setSource(T source) {
        this.source = source;
    }

    public boolean isSynchronizeFlag() {
        return synchronizeFlag;
    }

    public void setSynchronizeFlag(boolean synchronizeFlag) {
        this.synchronizeFlag = synchronizeFlag;
    }
}
